//
//  CreateJobReviewCoOwnerView.swift
//  GreenDeal
//
//  Created by Moennig Q on 2023/3/7.
//

import UIKit
import SnapKit
class CreateJobReviewCoOwnerView: View {
    let nameText = CreateJobReviewContentLabel()
    let relationShipText = CreateJobReviewContentLabel()
    override func setUpView() {
        let titleView = CreateJobReviewSectionView(R.string.localizable.coowneR().uppercased(),haveEditBtnFlag: false)
        //titleView
        self.addSubview(titleView)
        titleView.snp.makeConstraints { make in
            make.top.left.right.equalToSuperview()
            make.height.greaterThanOrEqualTo(0)
        }
        //name
        let nameTitle = CreateJobReviewTitleLabel(R.string.localizable.name())
        self.addSubview(nameTitle)
        nameTitle.snp.makeConstraints { make in
            make.top.equalTo(titleView.snp.bottom).offset(16)
            make.left.equalTo(16)
            make.size.greaterThanOrEqualTo(0)
        }
        self.addSubview(nameText)
        nameText.snp.makeConstraints { make in
            make.top.equalTo(nameTitle)
            make.right.equalTo(-16)
            make.size.greaterThanOrEqualTo(0)
        }
        //relationShip
        let relationShipTitle = CreateJobReviewTitleLabel(R.string.localizable.relationship())
        self.addSubview(relationShipTitle)
        relationShipTitle.snp.makeConstraints { make in
            make.top.equalTo(nameTitle.snp.bottom).offset(CREATEJOB_REVIEW_INTERNAL)
            make.left.equalTo(nameTitle)
            make.size.greaterThanOrEqualTo(0)
            make.bottom.equalTo(-16)
        }
        self.addSubview(relationShipText)
        relationShipText.snp.makeConstraints { make in
            make.top.equalTo(relationShipTitle)
            make.right.equalTo(nameText)
            make.size.greaterThanOrEqualTo(0)
        }
    }
    func setData(){
        self.nameText.text = CreateJobModelHelper.shared.createJobViewModel.propertyOwner.co_owner_full_name
        self.relationShipText.text = CreateJobModelHelper.shared.createJobViewModel.propertyOwner.co_owner_relation_ship_name
    }
}
